Skip to content

[cherry pick] Use TokenValidationParameter copy constructor to make a deep copy #3488

Merged
westin-m merged 3 commits into
dev8xfrom
westin/cherry-pick-tvp-clone
May 27, 2026
Merged

[cherry pick] Use TokenValidationParameter copy constructor to make a deep copy #3488
westin-m merged 3 commits into
dev8xfrom
westin/cherry-pick-tvp-clone

Conversation

@westin-m

Copy link
Copy Markdown
Contributor

cherry picks the fix for Bug 3423710: TokenValidationParameters.Clone does not make a deep copy

)

* make a deep copy with copy constructor

* PR feedback
@westin-m westin-m requested a review from a team as a code owner May 13, 2026 21:50
@westin-m westin-m changed the title Use TokenValidationParameter copy constructor to make a deep copy [cherry pick] Use TokenValidationParameter copy constructor to make a deep copy May 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cherry-picks a fix for Bug 3423710 by updating TokenValidationParameters.Clone()/copy-constructor behavior so cloned instances don’t share mutable collection state with the original, and updates tests/docs accordingly.

Changes:

  • Deep-copies collection properties in the TokenValidationParameters(TokenValidationParameters other) copy constructor (lists/dictionaries).
  • Updates Clone() implementation and XML documentation to reflect the intended clone semantics.
  • Extends TokenValidationParametersTests.Clone() with additional assertions around clone independence.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Microsoft.IdentityModel.Tokens/TokenValidationParameters.cs Updates the copy constructor and clone docs/implementation to avoid sharing mutable collections between original and clone.
test/Microsoft.IdentityModel.Tokens.Tests/TokenValidationParametersTests.cs Updates clone test expectations; should validate collection deep-copy behavior.

Comment thread src/Microsoft.IdentityModel.Tokens/TokenValidationParameters.cs Outdated
Comment thread src/Microsoft.IdentityModel.Tokens/TokenValidationParameters.cs Outdated
Comment thread test/Microsoft.IdentityModel.Tokens.Tests/TokenValidationParametersTests.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@westin-m westin-m merged commit 3c0c4dd into dev8x May 27, 2026
2 checks passed
@westin-m westin-m deleted the westin/cherry-pick-tvp-clone branch May 27, 2026 16:48
This was referenced Jun 2, 2026
github-actions Bot pushed a commit to Stella-sea/ryujinx-admin that referenced this pull request Jun 14, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [Microsoft.IdentityModel.JsonWebTokens](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) | `8.18.0` → `8.19.1` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.IdentityModel.JsonWebTokens/8.19.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.IdentityModel.JsonWebTokens/8.18.0/8.19.1?slim=true) |

---

### Release Notes

<details>
<summary>AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet (Microsoft.IdentityModel.JsonWebTokens)</summary>

### [`v8.19.1`](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/HEAD/CHANGELOG.md#8191)

[Compare Source](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.19.0...8.19.1)

\====

#### Bug Fixes

- Update `JwtSecurityTokenHandler` for `IssuerSigningKeyResolverUsingConfiguration` to take priority over `IssuerSigningKeyResolver`, matching the documented contract and the correct behavior already present in `JsonWebTokenHandler`. See [PR #&#8203;3519](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3519).

### [`v8.19.0`](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/HEAD/CHANGELOG.md#8190)

[Compare Source](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.18.0...8.19.0)

\====

#### New Features

- Add ML-DSA (FIPS 204) post-quantum signature support. See [PR #&#8203;3479](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3479).
- Cache custom crypto providers in CryptoProviderFactory. See [PR #&#8203;3489](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3489).

#### Bug Fixes

- Disable automatic redirects on default HttpClient for JKU retrieval. See [PR #&#8203;3494](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3494).
- Adjust rented buffer handling in claim set parsing. See [PR #&#8203;3493](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3493).
- Tidy null handling in SAML conditions validation. See [PR #&#8203;3491](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3491).
- Improve validation of `jku` claim. See [PR #&#8203;3481](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3481).
- Limit telemetry algorithm dimension cardinality. See [PR #&#8203;3490](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3490).
- Add defensive copy of collections in ValidationParameters. See [PR #&#8203;3492](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3492).
- Update TokenValidationParameter copy constructor to make a deep copy. See [PR #&#8203;3488](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3488).
- Update to fail-closed when replay protection isn't configured and other DPoP hardening. See [PR #&#8203;3505](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3505).
- Apply RFC 3986 section 6.2.2 normalization to DPoP `htu` comparison. See [PR #&#8203;3509](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3509).

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzguMCIsInVwZGF0ZWRJblZlciI6IjQzLjE3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/136
sondresjolyst pushed a commit to sondresjolyst/garge-api that referenced this pull request Jun 15, 2026
)

Updated
[System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet)
from 8.18.0 to 8.19.1.

<details>
<summary>Release notes</summary>

_Sourced from [System.IdentityModel.Tokens.Jwt's
releases](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases)._

## 8.19.1

## Bug Fixes
- Update `JwtSecurityTokenHandler` for
`IssuerSigningKeyResolverUsingConfiguration` to take priority over
`IssuerSigningKeyResolver`, matching the documented contract and the
correct behavior already present in `JsonWebTokenHandler`. See [PR
#​3519](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3519).

## 8.19.0

## New Features
- Add ML-DSA (FIPS 204) post-quantum signature support. See [PR
#​3479](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3479).
- Cache custom crypto providers in CryptoProviderFactory. See [PR
#​3489](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3489).

## Bug Fixes
- Disable automatic redirects on default HttpClient for JKU retrieval.
See [PR
#​3494](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3494).
- Adjust rented buffer handling in claim set parsing. See [PR
#​3493](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3493).
- Tidy null handling in SAML conditions validation. See [PR
#​3491](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3491).
- Improve validation of `jku` claim. See [PR
#​3481](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3481).
- Limit telemetry algorithm dimension cardinality. See [PR
#​3490](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3490).
- Add defensive copy of collections in ValidationParameters. See [PR
#​3492](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3492).
- Update TokenValidationParameter copy constructor to make a deep copy.
See [PR
#​3488](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3488).
- Update to fail-closed when replay protection isn't configured and
other DPoP hardening. See [PR
#​3505](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3505).
- Apply RFC 3986 section 6.2.2 normalization to DPoP `htu` comparison.
See [PR
#​3509](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3509).

Commits viewable in [compare
view](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.18.0...8.19.1).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=System.IdentityModel.Tokens.Jwt&package-manager=nuget&previous-version=8.18.0&new-version=8.19.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants